<template>
  <!-- 用户管理-新增 -->
  <div class="addUser">
    dsadsddadsassa
    <div
      class="tijian_add button_add"
      style="position: fixed; left: 0; bottom: 0; width: 100%"
    >
      <div class="btnBox">
        <el-button @click="back">取消</el-button>
        <el-button @click="add">{{this.$route.query.type==1 ? '修改' : '新增'}}</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      
    }
  },
  methods: {
        // 添加
    add() {
      this.$confirm('是否在离开页面前保存修改？', '确认信息', {
        distinguishCancelAndClose: true,
        confirmButtonText: '保存',
        cancelButtonText: '取消'
      }).then(() => {
        // if (this.$route.path === '/dealer') {

        // }
        this.$message({
          type: 'success',
          message: '保存修改'
        });
        this.$router.back()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消保存'
        })
      })
    },
    // 取消
    back() {
      this.$confirm('此操作将不保存该信息, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$router.back()
      }).catch(() => {

      });
    }
  }
}
</script>

<style lang="scss" scoped>
.addUser {
  padding: 0.1302rem 0.151rem;
  height: 5.224rem;
  border-radius: 0.0781rem;
  background-color: #fff;
  margin-bottom: 0.625rem;
}
</style>
